//
//  SiterAPI.h
//  sHome
//
//  Created by Henry on 2021/04/28.
//  Copyright © 2021 SiterWell. All rights reserved.
//

#ifndef SiterAPI_h
#define SiterAPI_h
#import "SiterSDK.h"
#import <AFNetworking/AFNetworking.h>
#import <SRWebSocket.h>

@interface Siter(Cloud)
-(AFHTTPSessionManager*) sessionWithDefaultAuthorization;
@end

@interface Siter(User)
-(void) setOnlineSite:(NSString* )domain;
-(NSString *)getDomain;
-(void) login:(NSString*)userName password:(NSString*) password withHost:(NSString *)host callbcak:(void(^)(id user,NSError*)) block;
-(void) logout;

@end

@interface Siter(Websocket)

-(void) recv:(id) filter obj:(id) obj callback:(void(^)(id obj,id data,NSError*)) block;
-(void) sendNet:(id)json toHost:(NSString *)host timeout:(NSTimeInterval) timeout callback:(void (^)(id, NSError *))block;
-(void) WsOpen;
//刷新access_token;
-(void) refreshacTokenwithCallbcak:(void(^)(id user,NSError*)) block;
@end

#endif /* SiterAPI_h */
